//
//  CompanyResumeManagementCell.m
//  Btpin
//
//  Created by Vic on 2019/3/30.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "CompanyResumeManagementCell.h"

@interface CompanyResumeManagementCell ()
{
    WorkerBaseView *baseView;
    
    UILabel *timeLbl;
    UILabel *rightLbl;
}
@end

@implementation CompanyResumeManagementCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
    }
    return self;
}
- (void)initUI {
    baseView = [[WorkerBaseView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, 95*Scale)];
    [self.contentView addSubview:baseView];
    
    timeLbl = [UIToolsControl initLabelWithFrame:CGRectMake(75*Scale, EndY(baseView)+5*Scale, WIDTH-80*Scale, 20*Scale) text:nil textColor:THEMECOLOR_OF_TEXT_cccccc font:Font_10];
    timeLbl.backgroundColor = COLOR_OF_CLEAR;
    [self.contentView addSubview:timeLbl];
    
    rightLbl = [UIToolsControl initLabelWithFrame:CGRectMake(0, StartY(timeLbl), WIDTH-15*Scale, ViewHeight(timeLbl)) text:nil textColor:THEMECOLOR_OF_TEXT_cccccc font:Font_12];
    rightLbl.textAlignment = NSTextAlignmentRight;
    rightLbl.backgroundColor = COLOR_OF_CLEAR;
    [self.contentView addSubview:rightLbl];
    
    UIView *lineView = [UIToolsControl initViewWithFrame:CGRectMake(0, EndY(timeLbl)+10*Scale, WIDTH, 8*Scale) backgroundColor:THEMECOLOR_OF_GRAY];
    [self.contentView addSubview:lineView];
}
- (void)reloadData {
    [baseView reloadData];
    
    timeLbl.text = @"2018-02-15 收到对方的简历";
    rightLbl.text = @"已邀约复试";
}
- (void)reloadDataModel:(WorkerModel *)model {
    [baseView reloadDataModel:model];
    
    timeLbl.text = [NSString stringWithFormat:@"%@ 收到对方的简历", model.apply_timeYYYYMMDD];
    
    // 申请状态 1-未处理 2-待沟通 3-不合适 4-已邀约复试
    switch ([model.stauts integerValue]) {
        case 1: { // 未处理
            rightLbl.text = @"未处理";
            rightLbl.textColor = THEMECOLOR_OF_GREEN;
        } break;
        case 2: { // 待沟通
            rightLbl.text = @"待沟通";
            rightLbl.textColor = THEMECOLOR_OF_BLUE;
        } break;
        case 3: { // 不合适
            rightLbl.text = @"不合适";
            rightLbl.textColor = THEMECOLOR_OF_TEXT_cccccc;
        } break;
        case 4: { // 已邀约复试
            rightLbl.text = @"已邀约复试";
            rightLbl.textColor = THEMECOLOR_OF_ORANGE;
        } break;
        default:
            break;
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
